<% if @lockedPipeline
     scope[:entity_wrapper_class] = "locked"
   end %>

<div class="entity_status_wrapper page_header <%= scope[:entity_wrapper_class] %>">
  <div class="row">
    <span class="page_name">Stage Details</span>
    <%= render :partial => "shared/pipeline_breadcrumb", :locals => {:scope => {:pipeline => @pipeline, :third => {:link => url_for_pipeline_value_stream_map(@pipeline), :text => @pipeline.getLabel()}, :fourth => @stage.getName()}} %>

    <% if @can_user_view_settings %>
        <div class="stage_detail_setting">
          <%= link_to '', edit_path_for_pipeline(@pipeline.getName()), class: 'icon16 setting' %>
        </div>
    <% end %>
<!--    FIXME - does this locking stuff work or can we remove? -->
    <% if @lockedPipeline %>
        <% if @pipeline.hasStage(@lockedPipeline) %>
            <% if @pipeline.canUnlock() %>
                <div class="locked_instance" id='unlock'>
                  <%== link_blocking_post_to_server :name => "Click to unlock",
                                                    :html => {},
                                                    :url => "/go/api/pipelines/#{@pipeline.getName()}/unlock",
                                                    :idForSpinner => "unlock" %>
                </div>
            <% else %>
                <div class="locked_instance">
                  <span>LOCKED</span>
                </div>
            <% end %>
        <% else %>
            <div class="locked_instance">
              (<%= link_to("Locked by #{@lockedPipeline.getPipelineLabel()}" , stage_detail_path_for_identifier(@lockedPipeline)) %>
              )
            </div>
        <% end %>
    <% elsif @pipeline.isLockable() %>
        <div class="locked_instance">
          <span>UNLOCKED</span>
        </div>
    <% end %>
    <a href="<%= @feed_api_url -%>">
      <div class="feed">&nbsp;</div>
    </a>
  </div>
</div>
